package com.bigshen.demo.annotation.configurecomponents.a2Scope;

import com.bigshen.demo.project.entity.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

@Configuration
public class MyConfig {

    /**
     *
     * singleton : 单例
     * prototype : 原型
     * request : 每次请求创建一次
     * session : 每个session创建一次
     * @return
     */
    @Bean
    @Scope("prototype")
    public Person person() {
        return new Person("shen", "18");
    }

}
